# -*- codeing: utf-8 -*-
# @Time     :2021/12/10 20:10
# @Author   :郭荣杰
#@File      :getTotalOrders.py
#@Software  : PyCharm
import time
import  redis
#127.0.0.1
#192.168.179.140
ip = '127.0.0.1'
password = ''
r1=redis.Redis(host=ip,password=password,port=6379,db=0,decode_responses=True)#redis默认连接db0
#得到总订单量
while(True):
    print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
    print(r1.get("TotalOrders"))
    print("\n")
    time.sleep(1)